package pl.PawelAndAlicja.badugiproject.main.Game;
import java.util.ArrayList;

//import game.Bet;

interface BiddingInterface {
	public int firstBet(int myPool, int myBet, ArrayList currentpool);
	public void check();
	public int rise(int myPool, int myBet, ArrayList pool);
	public int allIn(int myPool, ArrayList pool);
	public int call(int myBet, ArrayList pool);
	public int fold();
	}

public class Bidding implements BiddingInterface {

	private int myPool, myBet;
	ArrayList pool = new ArrayList();
	Bet betObject = new Bet();
	
	public int firstBet(int myPool, int myBet, ArrayList currentpool)
	{
		betObject.addBet(myBet, currentpool);
		return myPool = myPool - myBet;
	}

	public void check()
	{
		//doNothing
	}

	public int rise(int myPool, int myBet, ArrayList pool)
	{
		betObject.addBet(myBet, pool);
		return myPool = myPool - myBet;
	}

	public int allIn(int myPool, ArrayList pool)
	{
		betObject.addBet(myPool, pool);
		myPool = 0;
		return myPool;
	}

	public int call(int myPool, ArrayList pool)
	{
		Object myPoolBet;
		myPoolBet = pool.get(pool.size()-1);
		int poolBetSize = (Integer) myPoolBet;

		if(myPool>poolBetSize){
			betObject.addBet(poolBetSize, pool);
			return myPool = myPool - poolBetSize;
		}
		else{
            System.out.println("Your pool is too small.");
            return myPool;
        }
	}

	public int fold()
	{
		return myPool=0;
		//exit()
	}

}


